package com.yuexun.beilunpatient.ui.registration.model.impl;

import com.yuexun.beilunpatient.base.BaseEntity;
import com.yuexun.beilunpatient.ui.registration.api.RegistrationApi;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentArrageBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentDepBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentDepData;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentDepInfoBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentDocBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentDocInfoBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentHistoryBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentHistoryDetailBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentHospitalBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentLoginBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentPatientDetail;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentPayBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentSubmitBean;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentTimeSlotBean;
import com.yuexun.beilunpatient.ui.registration.model.IRegistrationModel;
import com.yuexun.beilunpatient.utils.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by chenss on 2018/10/18.
 */
public class RegistrationModel implements IRegistrationModel {

    private RegistrationApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public RegistrationApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(RegistrationApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<AppointmentLoginBean>> appointmentLogin(Map<String, String> praise) {
        api = ApiInstance();
        return api.appointmentLogin(praise);
    }

    @Override
    public Observable<BaseEntity<String>> appointmentRegister(Map<String, String> praise) {
        api = ApiInstance();
        return api.appointmentRegister(praise);
    }

    @Override
    public Observable<BaseEntity<String>> sendActiveCodeNoPassWord(Map<String, String> praise) {
        api = ApiInstance();
        return api.sendActiveCodeNoPassWord(praise);
    }

    @Override
    public Observable<BaseEntity<String>> appointmentActivationNoPassword(Map<String, String> praise) {
        api = ApiInstance();
        return api.appointmentActivationNoPassword(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentHospitalBean>> appointmenthospitalList(Map<String, String> praise) {
        api = ApiInstance();
        return api.appointmenthospitalList(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentDepData>> getAppointentDep(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointentDep(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentDepBean>> getAppointentDepCenter(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointentDepCenter(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentDocBean>> getAppointmentDocList(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointmentDocList(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentDepInfoBean>> getAppointmentDepinfo(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointmentDepinfo(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentArrageBean>> getAppointmentArrageList(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointmentArrageList(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentDocInfoBean>> getAppointmentDocInfo(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointmentDocInfo(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentTimeSlotBean>> getAppointmentTimeSlot(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointmentTimeSlot(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentSubmitBean>> toAppointment(Map<String, String> praise) {
        api = ApiInstance();
        return api.toAppointment(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentHistoryBean>> getAlreadyAppointmentList(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAlreadyAppointmentList(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentHistoryDetailBean>> getAppointentDetail(Map<String, String> praise) {
        api = ApiInstance();
        return api.getAppointentDetail(praise);
    }

    @Override
    public Observable<BaseEntity<String>> cancelAppoinment(Map<String, String> praise) {
        api = ApiInstance();
        return api.cancelAppoinment(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentPayBean>> toPayAppoinment(Map<String, String> praise) {
        api = ApiInstance();
        return api.toPayAppoinment(praise);
    }

    @Override
    public Observable<BaseEntity<AppointmentPatientDetail>> loadPatientInfoDetail(Map<String, String> praise) {
        api = ApiInstance();
        return api.loadPatientInfoDetail(praise);
    }
}
